From 8d8e83afa2dd8ab317fc9212fd291ec1095df18b Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 22 Dec 2022 22:17:45 +0100 Subject: [PATCH] fontdialog: Handle Escape better Closing the dialog by hitting Escape should have the same effect as clicking the cancel button. Make it so. --- gtk/gtkfontdialog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtkfontdialog.c b/gtk/gtkfontdialog.c index fdf6b23107..878456d94d 100644 --- a/gtk/gtkfontdialog.c +++ b/gtk/gtkfontdialog.c @@ -562,7 +562,8 @@ response_cb (GTask *task, } else if (response == GTK_RESPONSE_CLOSE) g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED, "Cancelled by application"); - else if (response == GTK_RESPONSE_CANCEL) + else if (response == GTK_RESPONSE_CANCEL || + response == GTK_RESPONSE_DELETE_EVENT) g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user"); else g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED, "Unknown failure (%d)", response); -- 2.30.2